package entity.hard;

import java.util.List;
import com.springboot.frame.excel.annotation.*;
import customHandler.MarriedCellHandler;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.IndexedColors;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Excel(sheetName = "老师学生信息表", headerHeight = 20, titleHeight = 80)
@TitleStyle(fillColor = IndexedColors.LAVENDER, fontSize = 30, fontUnderLine = true)
public class Teacher {

  private static final long serialVersionUID = 1L;

  @ExcelAttribute(value = "课程教师", fontColor = IndexedColors.AQUA, fontUnderLine = true,
      fillColor = IndexedColors.BLUE_GREY, fillPatternType = FillPatternType.SOLID_FOREGROUND, borderStyle = BorderStyle.MEDIUM)
  private String name;

  @ExcelAttribute(value = "课程名称", fontItalic = true, wrapText = true, needMerge = true)
  @HeaderStyle(fillColor = IndexedColors.BRIGHT_GREEN, fontName = "微软雅黑")
  private String course;

  @ExcelAttribute(value = "工资")
  private Double salary;

  @ExcelAttribute(value = "婚姻状况", typeHandler = MarriedCellHandler.class, fontStrikeout = true, needMerge = true)
  private boolean married;


  @ExcelAttribute(value = "学历")
  private Education education;

  @ExcelCollection(value = "学生")
  @HeaderStyle(fillColor = IndexedColors.INDIGO)
  private List<Student> students;

  public Teacher(String name, String course, Double salary, Boolean married, Education education) {
    this.name = name;
    this.course = course;
    this.salary = salary;
    this.married = married;
    this.education = education;
  }

}
